package test.com.newproject.framework.db.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import test.com.newproject.model.entity.BaseEntity;
import test.com.newproject.model.entity.TestEntity;

import test.com.newproject.framework.db.greendao.BaseEntityDao;
import test.com.newproject.framework.db.greendao.TestEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig baseEntityDaoConfig;
    private final DaoConfig testEntityDaoConfig;

    private final BaseEntityDao baseEntityDao;
    private final TestEntityDao testEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        baseEntityDaoConfig = daoConfigMap.get(BaseEntityDao.class).clone();
        baseEntityDaoConfig.initIdentityScope(type);

        testEntityDaoConfig = daoConfigMap.get(TestEntityDao.class).clone();
        testEntityDaoConfig.initIdentityScope(type);

        baseEntityDao = new BaseEntityDao(baseEntityDaoConfig, this);
        testEntityDao = new TestEntityDao(testEntityDaoConfig, this);

        registerDao(BaseEntity.class, baseEntityDao);
        registerDao(TestEntity.class, testEntityDao);
    }
    
    public void clear() {
        baseEntityDaoConfig.clearIdentityScope();
        testEntityDaoConfig.clearIdentityScope();
    }

    public BaseEntityDao getBaseEntityDao() {
        return baseEntityDao;
    }

    public TestEntityDao getTestEntityDao() {
        return testEntityDao;
    }

}
